#pragma once 

#include <string>
#include <optional>
#include <system_error>


namespace helper {
namespace sqlite {
  class QueryResult;
}//namespace sqlite
}//namespace helper


namespace helper {
namespace sqlite {
namespace stream {

class Scalar {
public:
  Scalar(QueryResult & r) ;
  ~Scalar();

  std::optional<std::string> text(std::error_code & ec) ;
  std::optional<double> real(std::error_code & ec) ;
  std::optional<int64_t> integer(std::error_code & ec) ;
  std::optional<std::string> binary(std::error_code & ec) ;

private:
  QueryResult & _result;
};

}//namespace stream
}//namespace sqlite
}//namespace helper
